﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DCT.CodeBox.Utility
{
    /// <summary>
    /// 异常工具类
    /// </summary>
    public static class ExceptionUtility
    {
        /// <summary>
        /// 参数中的字符串为空时，抛出的异常信息
        /// </summary>
        /// <param name="tag"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        public static ArgumentNullException StringEmptyOrNullException(string tag, params string[] args)
        {
            string paraName = tag + "=>";
            if (!CollectionUtility.IsEmptyOrNull(args))
            {
                paraName += string.Join("|", args);
            }
            string msg = "It's Not allowed empty or null";
            return new ArgumentNullException(paraName, msg); 
        }
    }
}
